package com.zhongc.advance.service.impl;/**
 * Created by Administrator on 2015-07-27.
 */

import com.zhongc.advance.dao.SecurityQuestionDao;
import com.zhongc.advance.info.SecurityQuestion;
import com.zhongc.advance.service.AdvanceSecurityQuestionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Description
 * @Version 1.0
 * @Author zhongc
 * @Email zhong_ch@foxmail.com
 * @History <li>Author: zhongc</li>
 * <li>Date: 2015-07-27</li>
 * <li>Version: 1.0</li>
 * <li>Content: create</li>
 */
@Repository
public class AdvanceSecurityQuestionServiceImpl implements AdvanceSecurityQuestionService {

    private Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private SecurityQuestionDao squestionDao;

    @Override
    public List<SecurityQuestion> selectQuestions() {
        logger.info("查询密保问题-->");
        return squestionDao.selectQuestion();
    }

    @Override
    public int addQuestion(String question) {
        logger.info("添加密保问题入参 question ->{}",question);
        return squestionDao.addQuestion(question);
    }

    @Override
    public int updateQuestion(String questionId, String question) {
        logger.info("更新密保问题入参 questionId->{},  question ->{}",questionId,question);

        return squestionDao.updateQuestion(questionId, questionId);
    }

}
